package com.yxw.yxnet_cd_center.customer_service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxw.yxnet_cd_center.customer_service.dto.GroupQueryDTO;
import com.yxw.yxnet_cd_center.customer_service.entity.YxCsGroupEntity;
import com.yxw.yxnet_cd_center.customer_service.vo.MemberVo;
import com.yxw.yxnet_cd_center.customer_service.vo.YxCsGroupVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GroupMapper extends BaseMapper<YxCsGroupEntity> {

    /**
     * 保存组成员到中间表
     * @param groupId
     * @param userIdList
     */
    void addGroupUser(@Param("groupId") Long groupId, @Param("list") List<Long> userIdList);

    /**
     * 删除组人员
     * @param groupId
     */
    void deleteGroupUserByGroupId(Long groupId);


    /**
     * 工作组分群-工作组列表查询
     * @param dto
     * @return
     */
    List<YxCsGroupVo> getFlockGroupList(Page<YxCsGroupVo> page,@Param("dto") GroupQueryDTO dto);

    /**
     * 工作组启用/禁用
     * @param groupId
     */
    void updateGroupStatusById(Long groupId);

    /**
     * 查询工作组成员
     * @param groupId
     * @return
     */
    List<MemberVo> getUserList(Long groupId);
}
